package com.yidu.DailyFinalTreatment.mapper;

import com.yidu.DailyFinalTreatment.entity.NetWorth;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 净值统计
 * @author 黄虎
 */
@Repository
@Mapper
public interface NetWorthMapper {
    /**
     * 查询净值统计
     * @param netWorthDate
     * @return
     */
    @Select("select * from netWorth where netWorthDate=#{netWorthDate} ")
    public List<NetWorth> selectNeyWorth(String netWorthDate);

    /**
     * 删除净值统计
     * @param netWorthDate 统计时间
     * @param fundId 基金编号
     */
    @Delete("delete from networth where netWorthDate=#{netWorthDate} ")
    public void deleteNetWorth(String netWorthDate,String fundId);

    /**
     * 插入净值统计
     * @param map
     * @return
     */
    @Insert("insert into networth(netWorthDate,fundId,projectId,projectName,${string}) " +
            "VALUES(#{netWorthDate},#{fundId},#{projectId},#{projectName},${stringTwo})")
    public int insertNetWorth(Map map);
}
